package com.cennavi.minemap.util;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class ShellUtil {
	public static String shell(String script) throws Exception {
		Process ps = Runtime.getRuntime().exec(script);
		ps.waitFor();
		BufferedReader br = new BufferedReader(new InputStreamReader(ps.getInputStream()));
		StringBuffer sb = new StringBuffer();
		String line;
		while ((line = br.readLine()) != null) {
			sb.append(line);
		}
		String result = sb.toString();
		return result;
	}
}
